package cn.itcast.consumer.clients;

import cn.itcast.consumer.config.FeginConfig;
import cn.itcast.consumer.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
//feign第三步，编写客户端
//此注解作用通过反射获取服务id，去eureka上拉去服务，负载均衡
@FeignClient(value = "user-service",fallback =UserClientFallback.class,
                                    configuration = FeginConfig.class)
public interface UserClient {
    @GetMapping("/user/{id}")
    User queryById(@PathVariable("id") Long id);
}
